import getConstantDay from './getConstantDay.js'
import {isWeek} from './isRange.js'

const top = '优秀'
const center = '平凡'
const bottom = '懒人'

function getRunRanking(weekCount, monthCount, list){
	if(weekCount > 5) return top
	let weekCList = []
	list.forEach(item => {
		if(isWeek(item.date)){
			weekCList.push(item)
		}
	})
	if(getConstantDay(weekCList) >= 4) return top
	if(monthCount >= 22) return top
	
	if(weekCount <= 3) return bottom
	if(monthCount <= 15) return bottom
	
	return center
}

export default getRunRanking